package com.ifinc.common.utils.test;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * User: luotao
 * Date: 13-11-27
 * Time: 15:54
 */
public class JettyServer {
    public static void startup(String path, String appname) throws Exception {
        startup(path, appname, 8088);
    }

    public static void startup(String path, String appname, int port) throws Exception {
        Server server = new Server(port);

        WebAppContext webapp = new WebAppContext(path, "/" + appname);
        server.setHandler(webapp);
        server.start();
        server.join();
    }


}